@extends('layouts.default') @section('main')
    <link rel="stylesheet" href="/css/uniform.css" />
    <link rel="stylesheet" href="/css/select2.css" />
    <div id="content">
        <div id="content-header">
            <div id="breadcrumb">
                <a href="{{url('home')}}" title="返回首页" class="tip-bottom"><i class="icon-home"></i> 首页</a>
                <a href="#" class="current">直通车使用申请</a>
            </div>
        </div>
        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span12">

                    <form action="{{url('ztcuseapply/search')}}" method="post">
                        <table>
                            <tr>
                                <th>
                                    <label >类型 :</label>
                                </th>
                                <th>
                                    <div class="controls">
                                        <select  name="is_send" class="span11" >
                                            <option value="">请选择</option>
                                            <option value="0">投资方邀约</option>
                                            <option value="1">项目方申请</option>
                                        </select>
                                    </div>
                                </th>
                                <th>
                                    <label >项目 :</label>
                                </th>
                                <th>
                                    <div class="controls">
                                        <input type="text" class="span11" name="project" value="" placeholder="项目" />
                                    </div>
                                </th>
                                <th>
                                    <label >状态 :</label>
                                </th>
                                <th>
                                    <div class="controls">
                                        <select  name="status" class="span11" >
                                            <option value="">请选择</option>
                                            <option value="-1">拒绝</option>
                                            <option value="0">等待</option>
                                            <option value="1">通过</option>
                                            <option value="2">等待对方应答</option>
                                            <option value="-2">资方拒绝调整的时间</option>
                                        </select>
                                    </div>
                                </th>

                                <th>
                                    <input type="hidden" name="_token" value="{{ csrf_token() }}">
                                    <div class="controls">
                                        <button type="submit" class="btn btn-info">查询</button>
                                    </div>
                                </th>
                            </tr>
                        </table>
                    </form>


                    <div class="widget-box">
                        <div class="widget-title"> <span class="icon"><i class="icon-th"></i></span>
                            <h5>使用申请</h5>
                        </div>
                        <div class="widget-content nopadding">
                            <table class="table table-bordered table-striped">
                                <thead>
                                <tr>
                                    <th>类型</th>
                                    <th>投资方</th>
                                    <th>项目方</th>
                                    <th>项目</th>
                                    <th>开始时间</th>
                                    <th>结束时间</th>
                                    <th>使用理由</th>
                                    <th>状态</th>
                                    <th>创客空间</th>
                                    <th>地址(没有空间时)</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($lists as $key => $list)
                                    <tr class="gradeX">
                                        <td>@if($list->is_send==1)项目方申请 @else 投资方邀约@endif</td>
                                        <td>@if(isset($list->throughtrain->user)) {{$list->throughtrain->user->realname or $list->throughtrain->user->nickname}} @endif</td>
                                        <td>@if(isset($list->user)){{$list->user->realname or $list->user->nickname}} @endif</td>
                                        <td>@if(isset($list->project)){{cut_str($list->project->subject,12)}} @endif</td>
                                        <td>{{date('Y-m-d', $list->begin_time)}}</td>
                                        <td>{{date('Y-m-d', $list->end_time)}}</td>
                                        <td>{{$list->reason}}</td>
                                        <td>@if($list->status==-1) 拒绝 @elseif($list->status==0) 等待 @elseif($list->status==1) 通过 @elseif($list->status==2) 等待对方应答 @elseif($list->status==-2) 资方拒绝调整的时间 @endif</td>
                                        <td>@if(isset($list->maker)){{cut_str($list->maker->name,12)}} @endif</td>
                                        <td>{{$list->address}}</td>
                                        <td class="center">
                                            @if(in_array('edit',$actions) && !$list->maker) <a data-original-title="编辑" class="tip" href="{{url('ztcuseapply/edit?id='.$list->id)}}"><i class="icon-pencil"></i></a>  @endif
                                        </td>
                                    </tr>
                                @endforeach
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <?php echo $lists->appends(['is_send' => $is_send,'project' => $project,'status' => $status])->render();?>
                </div>
            </div>
        </div>
    </div>
    <script src="/js/matrix.tables.js"></script>
@stop
